//
//  NetworkTool.swift
//  Weibo007
//
//  Created by 闫崇 on 15/12/14.
//  Copyright © 2015年 闫崇. All rights reserved.
//

import UIKit
import AFNetworking
class NetworkTool: AFHTTPSessionManager {
    
    // 创建单例
    
    private static let instance : NetworkTool = {
        
        //baseurl 必须要以 / 结尾
        
        let urlString = "https://api.weibo.com/"
        
        let url = NSURL(string: urlString)!
        
        let tools = NetworkTool(baseURL: url)
        
        tools.responseSerializer.acceptableContentTypes?.insert("text/plain")
        
        return tools
        
    }()
    
    //全局访问方法
    
    class func sharedNetworkTools() ->NetworkTool {
        
        return instance
        
    }
    
    
    
    
    

}
